
package com.wiesloch.mapper;

import java.util.List;

import com.wiesloch.po.Repertory;
import com.wiesloch.po.RepertoryExtends;

/**
 * <p>IntefaceName:RepertoryMapper</p>
 * <p>Description:</p>
 * <p> E-mail:jintao_iknow@163.com </p>
 * Date:     2016年5月17日 下午4:08:06 <br/>
 * @author   tao95
 * @version  1.0
 * @since    JDK 1.7
 *
 */
public interface RepertoryMapper {

	/**
	 * @description 当新添加一个分销商时对其批量添加相应的库存数据
	 * @param repertoryList
	 * @throws Exception
	 */
	public void insertRepertory(List<Repertory> repertoryList) throws Exception;
	
	/**
	 * @desription 根据分销商id查询该分销商下的所有商品的库存
	 * @param repertory
	 * @return
	 * @throws Exception
	 */
	public List<RepertoryExtends> selectRepertoryBySeriesIdAndDistributorId(Repertory repertory) throws Exception;
	
	/**
	 * @description 根据该分销商品的库存id查询其父分销商的库存容量
	 * @param repertoryExtends
	 * @return
	 * @throws Exception
	 */
	public RepertoryExtends selectParentRepertory(RepertoryExtends repertoryExtends) throws Exception;
	
	/**
	 * @description 更新进货的分销商的库存
	 * @param repertoryExtends
	 * @throws Exception
	 */
	public void updateInRepertoryAmount(RepertoryExtends repertoryExtends) throws Exception;
	
	/**
	 * @description 更新出货的分销商的库存
	 * @param repertoryExtends
	 * @throws Exception
	 */
	public void updateOutRepertoryAmount(RepertoryExtends repertoryExtends) throws Exception;
}
